##title=finds the first component with the specified Zope if, or all if getAll is set
##parameters=id, getAll=False

catalog = context.portal_catalog
rs = catalog(getId=id)

if getAll:
    return [brain.getObject() for brain in rs]

for brain in rs:
    return brain.getObject()